import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess, resultSuccess } from '../_util';

const demoList = (() => {
  const result: any[] = [];
  for (let index = 0; index < 30; index++) {
    result.push({
      id: `${index}`,
      billNumber: '@string(lower,10)',
      'billType|1': ['变更单', '归还单', '转移单'],
      'billState|1': ['审核', '草稿', '驳回'],
      operationNumber: '@integer(1, 50)',
    });
  }
  return result;
})();
enum Api {
  list = '/todo-list/todolist',
}
const prefix = '/jeecgboot';
export default [
  {
    url: prefix + Api.list,
    timeout: 1000,
    method: 'get',
    response: ({ query }) => {
      const { page = 1, pageSize = 20 } = query;
      return resultPageSuccess(page, pageSize, demoList);
    },
  },
] as MockMethod[];
